package cn.bonoon.kernel.web.handlers.loader;

import java.lang.reflect.AnnotatedElement;
import java.util.List;

import cn.bonoon.handler.impl.StandardAutoManager;
import cn.bonoon.kernel.events.ReadEvent;
import cn.bonoon.kernel.support.searcher.Finder;
import cn.bonoon.kernel.support.services.ISearchable;
import cn.bonoon.kernel.web.annotations.AutoDataLoader;

/**
 * 用于treegrid加载数据
 * @author jackson
 *
 * @param <E>
 * @param <N>
 */
public class NodeLoaderHandler extends AbstractSearchableLoaderHandler {

	public NodeLoaderHandler(ISearchable searchable, Class<?> resultClass, AnnotatedElement aEle) throws Exception {
		super(searchable, resultClass, null, aEle);
	}
	
	public NodeLoaderHandler(StandardAutoManager manager, Class<?> resultClass, AutoDataLoader loader) throws Exception {
		super(manager, resultClass, null, loader);
	}
	

	@Override
	protected List<Object> __parseResult(Finder finder, ReadEvent event) throws Exception {
		return finder.tryLoadRoot();
	}

//	@Override
//	public List<?> execute(ReadEvent event) throws Exception {
//		return searcher.tryLoadRoot(event, resultClass);
//	}
}
